// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: shared_lib_dummy.hpp 229 2008-09-15 13:39:09Z heavyzheng $
//

#ifndef ZZHENG_UTILITY_SHARED_LIB_DUMMY_HPP_20080828__
#define ZZHENG_UTILITY_SHARED_LIB_DUMMY_HPP_20080828__

#include <zzheng/config.hpp>
#include <boost/noncopyable.hpp>
#include <string>

#ifndef DOXYGEN_SHOULD_SKIP_THIS

namespace zzheng {
namespace sys {
namespace detail {

    //! This class wraps a shared library on the win32 platform.
    class shared_lib_wrapper: private boost::noncopyable {

    public:

        explicit shared_lib_wrapper(const std::string&, bool) {
            // Do nothing.
        }

        // Use auto-generated destructor.

        //! The dummy shared library can never be loaded.
        //! \return always false.
        bool loaded() const {
            return false;
        }

        //! The dummy shared library always fails to be loaded.
        //! \return always true.
        bool failed() const {
            return true;
        }

        //! The dummy shared library is empty.
        //! \return always null.
        void* get_fn_addr(const std::string&) {
            return 0;
        }

    }; // class shared_lib_wrapper

} // namespace zzheng::sys::detail
} // namespace zzheng::sys
} // namespace zzheng

#endif // !DOXYGEN_SHOULD_SKIP_THIS

#endif // ZZHENG_UTILITY_SHARED_LIB_DUMMY_HPP_20080828__


